<template>
<table class='add_skill'>
    <tr><th colspan="2">新增技能</th></tr>
  <tr>
      <td>技能名称<input class="input-1" ref="add1" style="width: 200px; margin: 0 auto;"/></td>
      <td><div class="blank"></div></td>
 </tr>
 <tr>
      <td>使用日期<input class="input-1" ref="add2" style="width: 200px; margin: 0 auto;"/></td>
      <td><div class="blank"></div></td>
 </tr>
 <tr>
      <td>使用时间（月）<input class="input-1" ref="add3" style="width: 200px; margin: 0 auto;"/></td>
      <td><div class="blank"></div></td>
 </tr>
 <tr>
      <td>熟练程度<input class="input-1" ref="add4" style="width: 200px; margin: 0 auto;"/></td>
      <td><div class="blank"></div></td>
 </tr>
 <tr>
      <td>备注<input class="input-1" ref="add5" style="width: 200px; margin: 0 auto;"/></td>
      <td><div class="blank"></div></td>
 </tr>
 <tr>
      <td colspan="2">
        <div  class="submit">
          <a-button type="primary" @click="add()">
           保存
          </a-button>
        </div>
      </td>
    </tr>
  </table>
</template>
<script>
export default {
  name:'add_skill',
  data(){
    return{
      list:[
        {
          num1:'',
          num2:'',
          num3:'',
          num4:'',
          num5:''
        }
      ]
    }
  },
  methods: {
    add(){
      console.log(this.$refs.add1.value)
    this.list[0].num1 = this.$refs.add1.value
    this.list[0].num2 = this.$refs.add2.value
    this.list[0].num3 = this.$refs.add3.value
    this.list[0].num4 = this.$refs.add4.value
    this.list[0].num5 = this.$refs.add5.value
    this.$store.state.list1 = this.list
    console.log(this.$store.state.list1)
    }
  },
}
</script>
<style>
.add_skill{
  margin: 0 auto;
  width: 400px;
  height: 400px;
  background-color: rgb(247, 245, 245);
}
 td{
   text-align: right;
 }
 .blank{
   width: 50px;
 }
 .submit{
   display: flex;
   justify-content: center;
   align-items: center;
 }
 .ant-btn-primary{
   margin: 20px;
   background:rgb(240, 200, 128);
 }
 /* input{
   box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-variant: tabular-nums;
    list-style: none;
    font-feature-settings: 'tnum';
    position: relative;
    display: inline-block;
    width: 100%;
    height: 32px;
    padding: 4px 11px;
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
    line-height: 1.5;
    background-color: #fff;
    background-image: none;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
 } */
</style>